#!/bin/sh

# 复制项目的文件到对应docker路径，便于一键生成镜像。
usage() {
	echo "Usage: sh copy.sh"
	exit 1
}

echo "begin package "
#打包开始
cd ..
mvn clean install -Dmaven.test.skip=true
#前端
cd ./xy-ui
npm install --registry=https://registry.npmmirror.com
npm run build:prod
cd ../docker
# copy sql
echo "begin copy sql "
cp ../sql/vctgo_platform.sql ./mysql/db
cp ../sql/vctgo_config.sql ./mysql/db

# copy html
echo "begin copy html "
cp -r ../xy-ui/dist/** ./nginx/html/dist


# copy jar
echo "begin copy xy-gateway "
cp ../xy-gateway/target/xy-gateway.jar ./vctgo/gateway/jar

echo "begin copy xy-auth "
cp ../xy-auth/target/xy-auth.jar ./vctgo/auth/jar

echo "begin copy xy-demo "
cp ../xy-demo/target/xy-demo.jar ./vctgo/demo/jar

echo "begin copy xy-monitor "
cp ../xy-visual/xy-monitor/target/xy-monitor.jar  ./vctgo/visual/monitor/jar

echo "begin copy xy-system "
cp ../xy-modules/xy-system/target/xy-system.jar ./vctgo/modules/system/jar

echo "begin copy xy-file "
cp ../xy-modules/xy-file/target/xy-file.jar ./vctgo/modules/file/jar

echo "begin copy xy-gen "
cp ../xy-modules/xy-gen/target/xy-gen.jar ./vctgo/modules/gen/jar

echo "begin copy xy-job "
cp ../xy-modules/xy-job/target/xy-job.jar ./vctgo/modules/job/jar

